package com.zy.transaction.dao;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

public class TransferDaoImpl extends JdbcDaoSupport implements TransferDao {

    @Override
    public void payMoney(String name, Long amount) {
        String sql = "update user set money=money-? where name=?";
        this.getJdbcTemplate().update(sql, amount, name);
    }

    @Override
    public void collectMoney(String name, Long amount) {
        String sql = "update user set money=money+? where name=?";
        this.getJdbcTemplate().update(sql, amount, name);
    }
}
